{
 "cells": [
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": [
    "在接下来的内容中，所提到的函数中将会频繁出现以下参数:  \n",
    "* img: 传入的图像，与前文提到的一致，是numpy.ndarray三维数组第一个维度是高，第二个维度是宽，第三个维度是一个三元组，分别表示图像的BGR\n",
    "* color: 如果是BGR，直接使用元组传入，例如(255,0,0)\n",
    "* 厚度: 表示线或圆的粗细。如果对一个闭合图形传入-1，则会填充图形内部。默认值为1\n",
    "* lineType: 线的类型  \n",
    "\n",
    "<br>\n",
    "### 画线\n",
    "使用cv.line()函数\n"
   ],
   "id": "8586c5dd69abbb18"
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-01-19T16:43:16.135047Z",
     "start_time": "2025-01-19T16:43:10.675680Z"
    }
   },
   "cell_type": "code",
   "source": [
    "import numpy as np\n",
    "import cv2 as cv\n",
    "img=np.zeros((512,512,3),np.uint8)\n",
    "cv.line(img,(0,0),(511,511),(255,0,0),5)\n",
    "cv.imshow('img',img)\n",
    "cv.waitKey(0)\n",
    "cv.destroyAllWindows()"
   ],
   "id": "3f96b555b8fc69f",
   "outputs": [],
   "execution_count": 1
  },
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": "",
   "id": "1a02a4e1b193e48d"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
